Error resolution // Résolution d'erreur
Prevent the Win32 Console Application from closing // Empêcher la fermeture de l'application console Win32

VisualStudio

[VisualStudio] Prevent the Win32 Console Application from closing



1. To prevent the command window from closing as soon as the program finishes execution, add the following line to the end of your main function :
  • getchar();

-> This library function waits for any input key, and will therefore keep your console window open until a key is pressed!



Error resolution

[Error resolution] Empêcher la fermeture de l'application console Win32



1. Pour empêcher la fenêtre de commande de se fermer dès que l'exécution du programme est terminée, ajoutez la ligne suivante à la fin de votre fonction principale :
  • getchar();

-> Cette fonction de bibliothèque attend toute touche de saisie et laisse donc votre fenêtre de console ouverte jusqu'à ce qu'une touche soit enfoncée !